package com._jmx;

import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.lang.management.ManagementFactory;

/**
 * @Author: huangya
 * @Date: 2020/4/19
 * @Description:
 */
public class TomcatMonitorTest {
    public static void main(String args[]) throws Exception {
        MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
        TomcatUtilMBean tomcatUtil = new TomcatUtil();
        mBeanServer.registerMBean(tomcatUtil, new ObjectName("tomcatUtil2222:name=tomcatUtil"));
        while (true) {
            Thread.sleep(1000);
        }
    }
}
